/*
 * @Author: yangy aidreams@sina.com
 * @Date: 2024-03-04 10:34:10
 * @LastEditors: yangy aidreams@sina.com
 * @LastEditTime: 2024-03-04 10:34:17
 * @FilePath: /vue3-framework/src/router/index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { createRouter, createWebHashHistory } from "vue-router";

// 通过 createRouter 创建路由实例。
const router = createRouter({
  history: createWebHashHistory(), // 这里有两种形式，createWebHistory 和 createWebHashHistory，我采用后者
  // 路径 —> 组件，对应配置。
  routes: [
    {
      path: "/",
      redirect: "/home",
    },
    {
      path: "/home",
      name: "home",
      component: () => import("@/views/Home.vue"),
    },
    {
      path: "/about",
      name: "about",
      component: () => import("@/views/About.vue"),
    },
  ],
});

export default router; // 将路由实例抛出
